﻿<common:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="TutorTemplate.WritePage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    IsTabStop="false"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:TutorTemplate"
    xmlns:common="using:TutorTemplate.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.Resources>
    </Page.Resources>

    <!--Background="#FFFC70A9"-->
    <Grid>
        <Grid.Background>
            <ImageBrush ImageSource="/Assets/backgroundwall.jpg" Stretch="Fill"/>
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Back button and page title -->
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
            <TextBlock x:Name="pageTitle" Grid.Column="1" Text="Page Header" Style="{StaticResource PageHeaderTextStyle}"/>
            <Image x:Name="imgApplogo" Grid.Column="1" Margin="0,0,10,0" Source="/Assets/AppLogo.png" Stretch="Fill" Width="234" Height="100" HorizontalAlignment="Right" VerticalAlignment="Center"/>
        </Grid>

        <ScrollViewer x:Name="scrlMain" Margin="0" Grid.Row="1" VerticalScrollMode="Disabled" VerticalScrollBarVisibility="Disabled" 
                      HorizontalScrollBarVisibility="Auto" ZoomMode="Disabled" HorizontalScrollMode="Enabled">
            <Grid x:Name="grdMain" Margin="120,40,0,0">
                <StackPanel x:Name="spContainer" Orientation="Horizontal" VerticalAlignment="Top">
                    <Grid Height="460" Width="442" Background="#FF08635E">
                        <TextBlock HorizontalAlignment="Left" Height="250" Margin="25,-50,0,0" TextWrapping="Wrap" Text="G" VerticalAlignment="Top" Width="150" FontSize="206.667" FontFamily="Segoe UI"/>
                        <Image Margin="0,0,40,80" Source="images/Apple-01.png" Stretch="Fill" Width="254" Height="320" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
                        <TextBlock HorizontalAlignment="Left"  Margin="30,0,0,10" TextWrapping="Wrap" VerticalAlignment="Bottom" Width="422" Text="tutor app" FontSize="80" 
                               FontFamily="Segoe UI" TextAlignment="Center"/>
                    </Grid>
                    <Grid x:Name="grdDesc" Height="460" Margin="20,0,0,0" Width="725" Background="#FFE6E6E6">
                        <TextBlock Text="Your description goes here." TextWrapping="Wrap" FontSize="18" FontFamily="Segio UI" Margin="10"/>
                    </Grid>
                </StackPanel>
            </Grid>
        </ScrollViewer>

        <!--Snapped View-->
        <Grid x:Name="grdSnapped" Grid.RowSpan="2" Visibility="Collapsed">
            <Grid.RowDefinitions>
                <RowDefinition Height="140"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Image Source="/Assets/Images/mainlogo.png" Width="188" Height="88" HorizontalAlignment="Left" Margin="40,20,0,0"/>
            <TextBlock Text="Switch fullscreen to view content" FontSize="32" TextAlignment="Center" VerticalAlignment="Center" 
                       Grid.RowSpan="2" TextWrapping="Wrap" Margin="10"/>
        </Grid>

        <VisualStateManager.VisualStateGroups>

            <!-- Visual states reflect the application's view state -->
            <VisualStateGroup>
                <VisualState x:Name="FullScreenLandscape"/>
                <VisualState x:Name="Filled"/>
                <VisualState x:Name="FullScreenPortrait">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="spContainer" Storyboard.TargetProperty="Orientation">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Vertical"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="grdMain" Storyboard.TargetProperty="Margin">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="15"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="grdDesc" Storyboard.TargetProperty="Margin">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="0,10,0,0"/>
                        </ObjectAnimationUsingKeyFrames>

                    </Storyboard>
                </VisualState>
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="scrlMain" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="grdSnapped" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="imgApplogo" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</common:LayoutAwarePage>
